/*
 * MantenedorCliente.java
 *
 * Created on __DATE__, __TIME__
 */

package cl.pelu.operacion;

import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.beans.PropertyVetoException;

import javax.swing.JOptionPane;

import cl.pelu.busqueda.BusquedaCliente;
import cl.pelu.main.PeluqueriaApp;

/**
 *
 * @author  __USER__
 */
public class MantenedorCliente extends javax.swing.JInternalFrame {

	private static MantenedorCliente myInstance;

	/** Creates new form MantenedorCliente */
	public MantenedorCliente() {
		initComponents();
	}

	public MantenedorCliente(String rut) {

		this.initComponents();
		this.rut_cliente_txt.setText(rut);
	}

	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	//GEN-BEGIN:initComponents
	// <editor-fold defaultstate="collapsed" desc="Generated Code">
	private void initComponents() {

		registroClienteLabel = new javax.swing.JLabel();
		datosClienteLayeredPane = new javax.swing.JLayeredPane();
		nombreTextField = new javax.swing.JTextField();
		rut_cliente_txt = new javax.swing.JTextField();
		direccionTextField = new javax.swing.JTextField();
		telefonoTextField = new javax.swing.JTextField();
		correoTextField = new javax.swing.JTextField();
		rutLabel = new javax.swing.JLabel();
		bombreLabel = new javax.swing.JLabel();
		direccionLabel = new javax.swing.JLabel();
		telefonoLabel = new javax.swing.JLabel();
		emailLabel = new javax.swing.JLabel();
		buscarButton = new javax.swing.JButton();
		guardarButton = new javax.swing.JButton();
		eliminarButton = new javax.swing.JButton();
		actividadLayeredPane = new javax.swing.JLayeredPane();
		jScrollPane1 = new javax.swing.JScrollPane();
		actividadTable = new javax.swing.JTable();
		agregarActividadButton = new javax.swing.JButton();
		fechaLabel = new javax.swing.JLabel();
		fechaTextField = new javax.swing.JTextField();

		setClosable(true);

		registroClienteLabel.setFont(new java.awt.Font("Ubuntu", 0, 24));
		registroClienteLabel.setText("Registro Clientes");

		datosClienteLayeredPane.setBorder(javax.swing.BorderFactory
				.createTitledBorder(
						javax.swing.BorderFactory.createEtchedBorder(),
						"Datos Cliente"));
		nombreTextField.setBounds(140, 60, 322, -1);
		datosClienteLayeredPane.add(nombreTextField,
				javax.swing.JLayeredPane.DEFAULT_LAYER);
		rut_cliente_txt.setBounds(140, 30, 320, -1);
		datosClienteLayeredPane.add(rut_cliente_txt,
				javax.swing.JLayeredPane.DEFAULT_LAYER);

		direccionTextField
				.addActionListener(new java.awt.event.ActionListener() {
					public void actionPerformed(java.awt.event.ActionEvent evt) {
						direccionTextFieldActionPerformed(evt);
					}
				});
		direccionTextField.setBounds(140, 90, 322, -1);
		datosClienteLayeredPane.add(direccionTextField,
				javax.swing.JLayeredPane.DEFAULT_LAYER);

		telefonoTextField
				.addActionListener(new java.awt.event.ActionListener() {
					public void actionPerformed(java.awt.event.ActionEvent evt) {
						telefonoTextFieldActionPerformed(evt);
					}
				});
		telefonoTextField.setBounds(140, 120, 322, -1);
		datosClienteLayeredPane.add(telefonoTextField,
				javax.swing.JLayeredPane.DEFAULT_LAYER);
		correoTextField.setBounds(140, 150, 322, -1);
		datosClienteLayeredPane.add(correoTextField,
				javax.swing.JLayeredPane.DEFAULT_LAYER);

		rutLabel.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
		rutLabel.setText("rut");
		rutLabel.setBounds(20, 30, 90, -1);
		datosClienteLayeredPane.add(rutLabel,
				javax.swing.JLayeredPane.DEFAULT_LAYER);

		bombreLabel.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
		bombreLabel.setText("nombre");
		bombreLabel.setBounds(20, 60, 90, -1);
		datosClienteLayeredPane.add(bombreLabel,
				javax.swing.JLayeredPane.DEFAULT_LAYER);

		direccionLabel.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
		direccionLabel.setText("direccion");
		direccionLabel.setBounds(20, 90, 90, -1);
		datosClienteLayeredPane.add(direccionLabel,
				javax.swing.JLayeredPane.DEFAULT_LAYER);

		telefonoLabel.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
		telefonoLabel.setText("telefono");
		telefonoLabel.setBounds(20, 120, 90, -1);
		datosClienteLayeredPane.add(telefonoLabel,
				javax.swing.JLayeredPane.DEFAULT_LAYER);

		emailLabel.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
		emailLabel.setText("e - mail");
		emailLabel.setBounds(20, 150, 100, -1);
		datosClienteLayeredPane.add(emailLabel,
				javax.swing.JLayeredPane.DEFAULT_LAYER);

		buscarButton.setText("buscar");
		buscarButton.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				buscarButtonActionPerformed(evt);
			}

			private void buscarButtonActionPerformed(ActionEvent evt) {
				// TODO Auto-generated method stub
				
			}
		});
		buscarButton.setBounds(70, 210, 140, -1);
		datosClienteLayeredPane.add(buscarButton,
				javax.swing.JLayeredPane.DEFAULT_LAYER);

		guardarButton.setText("guardar");
		guardarButton.setBounds(240, 210, 150, -1);
		datosClienteLayeredPane.add(guardarButton,
				javax.swing.JLayeredPane.DEFAULT_LAYER);

		eliminarButton.setText("eliminar");
		eliminarButton.setBounds(410, 210, 140, -1);
		datosClienteLayeredPane.add(eliminarButton,
				javax.swing.JLayeredPane.DEFAULT_LAYER);

		actividadLayeredPane.setBorder(javax.swing.BorderFactory
				.createTitledBorder(
						javax.swing.BorderFactory.createEtchedBorder(),
						"Actividad"));

		actividadTable.setModel(new javax.swing.table.DefaultTableModel(
				new Object[][] { { null, null, null, null, null },
						{ null, null, null, null, null },
						{ null, null, null, null, null },
						{ null, null, null, null, null } }, new String[] {
						"fecha", "nombre servicio", "descripcion", "monto",
						"materiales" }));
		jScrollPane1.setViewportView(actividadTable);

		jScrollPane1.setBounds(90, 20, 494, 94);
		actividadLayeredPane.add(jScrollPane1,
				javax.swing.JLayeredPane.DEFAULT_LAYER);

		agregarActividadButton.setText("Agregar Actividad");
		agregarActividadButton
				.addActionListener(new java.awt.event.ActionListener() {
					public void actionPerformed(java.awt.event.ActionEvent evt) {
						agregarActividadButtonActionPerformed(evt);
					}

					private void agregarActividadButtonActionPerformed(
							ActionEvent evt) {
						// TODO Auto-generated method stub
						
					}
				});
		agregarActividadButton.setBounds(390, 130, 220, -1);
		actividadLayeredPane.add(agregarActividadButton,
				javax.swing.JLayeredPane.DEFAULT_LAYER);

		fechaLabel.setText("fecha");

		fechaTextField.setText("31/02/2011");

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
				getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						javax.swing.GroupLayout.Alignment.TRAILING,
						layout.createSequentialGroup()
								.addContainerGap()
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.TRAILING)
												.addComponent(
														actividadLayeredPane,
														javax.swing.GroupLayout.Alignment.LEADING,
														javax.swing.GroupLayout.DEFAULT_SIZE,
														665, Short.MAX_VALUE)
												.addComponent(
														datosClienteLayeredPane,
														javax.swing.GroupLayout.Alignment.LEADING,
														javax.swing.GroupLayout.DEFAULT_SIZE,
														665, Short.MAX_VALUE)
												.addGroup(
														layout.createSequentialGroup()
																.addComponent(
																		registroClienteLabel)
																.addPreferredGap(
																		javax.swing.LayoutStyle.ComponentPlacement.RELATED,
																		269,
																		Short.MAX_VALUE)
																.addComponent(
																		fechaLabel)
																.addGap(49, 49,
																		49)
																.addComponent(
																		fechaTextField,
																		javax.swing.GroupLayout.PREFERRED_SIZE,
																		javax.swing.GroupLayout.DEFAULT_SIZE,
																		javax.swing.GroupLayout.PREFERRED_SIZE)
																.addGap(58, 58,
																		58)))
								.addGap(84, 84, 84)));
		layout.setVerticalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addContainerGap()
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.BASELINE)
												.addComponent(
														registroClienteLabel)
												.addComponent(
														fechaTextField,
														javax.swing.GroupLayout.PREFERRED_SIZE,
														javax.swing.GroupLayout.DEFAULT_SIZE,
														javax.swing.GroupLayout.PREFERRED_SIZE)
												.addComponent(fechaLabel))
								.addGap(18, 18, 18)
								.addComponent(datosClienteLayeredPane,
										javax.swing.GroupLayout.PREFERRED_SIZE,
										271,
										javax.swing.GroupLayout.PREFERRED_SIZE)
								.addGap(28, 28, 28)
								.addComponent(actividadLayeredPane,
										javax.swing.GroupLayout.PREFERRED_SIZE,
										170,
										javax.swing.GroupLayout.PREFERRED_SIZE)
								.addContainerGap(
										javax.swing.GroupLayout.DEFAULT_SIZE,
										Short.MAX_VALUE)));

		pack();
	}// </editor-fold>
	//GEN-END:initComponents



	void direccionTextFieldActionPerformed(java.awt.event.ActionEvent evt) {
		// TODO add your handling code here:
	}

	void telefonoTextFieldActionPerformed(java.awt.event.ActionEvent evt) {
		// TODO add your handling code here:
	}

	//GEN-BEGIN:v

	//GEN-BEGIN:variables
	// Variables declaration - do not modify
	private javax.swing.JLayeredPane actividadLayeredPane;
	private javax.swing.JTable actividadTable;
	private javax.swing.JButton agregarActividadButton;
	private javax.swing.JLabel bombreLabel;
	private javax.swing.JButton buscarButton;
	private javax.swing.JTextField correoTextField;
	private javax.swing.JLayeredPane datosClienteLayeredPane;
	private javax.swing.JLabel direccionLabel;
	private javax.swing.JTextField direccionTextField;
	private javax.swing.JButton eliminarButton;
	private javax.swing.JLabel emailLabel;
	private javax.swing.JLabel fechaLabel;
	private javax.swing.JTextField fechaTextField;
	private javax.swing.JButton guardarButton;
	private javax.swing.JScrollPane jScrollPane1;
	private javax.swing.JTextField nombreTextField;
	private javax.swing.JLabel registroClienteLabel;
	private javax.swing.JLabel rutLabel;
	private javax.swing.JTextField rut_cliente_txt;
	private javax.swing.JLabel telefonoLabel;
	private javax.swing.JTextField telefonoTextField;

	// End of variables declaration//GEN-END:variables

	public static MantenedorCliente getInstance() throws PropertyVetoException {
		if (myInstance == null) {
			myInstance = new MantenedorCliente();
		}
		return myInstance;
	}

}